﻿<UserControl x:Class="DictationToolSilverlight.View.DictationView"
             xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <sdk:TabControl Grid.Row="0">
            <sdk:TabItem Header="Dictation" IsSelected="{Binding Path=Select}" FontSize="12" >
                <TextBox BorderBrush="LightGray" Text="{Binding Path=DictationText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" FontSize="{Binding Path=Value,ElementName=font}" />
            </sdk:TabItem>
            <sdk:TabItem Header="Original Text" FontSize="12" >
                <TextBox BorderBrush="LightGray" Text="{Binding Path=OriginalText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" FontSize="{Binding Path=Value,ElementName=font}"/>
            </sdk:TabItem>
            <sdk:TabItem Header="Compared" IsSelected="{Binding Path=IsCompared, Mode=TwoWay}" FontSize="12" >
                <RichTextBox x:Name="richtext" FontSize="{Binding Path=Value,ElementName=font}" IsReadOnly="True"/>
            </sdk:TabItem>
        </sdk:TabControl>

        <Grid Grid.Row="1" Margin="0,5">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Text="{Binding Path=CorrectPercent}" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="#FF3C8DC5"/>
            <TextBlock Grid.Column="1" Text="{Binding Path=TotalTime}" VerticalAlignment="Center" Foreground="#FF3C8DC5" Margin="15,0,0,0"/>
            <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
                <Slider x:Name="font" Maximum="30" Minimum="12" Width="50" HorizontalAlignment="Right"  />
                <TextBlock Text="{Binding Path=Value, ElementName=font, Converter={StaticResource ValueToFontSize}}" VerticalAlignment="Bottom" Foreground="#FF3C8DC5" Margin="3,0,15,0"/>
            </StackPanel>
            <StackPanel Grid.Column="2" Orientation="Horizontal">
                <Button Content=" Compare By Char " HorizontalAlignment="Right" Command="{Binding Path=CompareCharCommand, Mode=OneTime}"/>
                <Button Content=" Compare By String " HorizontalAlignment="Right" Command="{Binding Path=CompareStringCommand, Mode=OneTime}" Margin="5,0,0,0"/>
            </StackPanel>
        </Grid>
    </Grid>
</UserControl>
